<template>
	<view class="container">
		<view class="input-item">
			<u--input placeholder="手机号" border="surround" v-model="user.cellphone"></u--input>
		</view>
		<view class="input-item">
			<u--input placeholder="密码" border="surround" type="password" v-model="user.password"></u--input>
		</view>
		<view class="input-item">
			<u-button type="primary" color="#EB1625" @click="login">登录</u-button>
		</view>
		<view class="input-item">
			<view class="input-item-0">
				<u-icon name="lock"></u-icon>
				<text>忘记密码</text>
			</view>
			<view class="input-item-0">
				<u-icon name="phone"></u-icon>
				<text>快速注册</text>
			</view>
		</view>
	</view>
</template>

<script>
	import {createNamespacedHelpers} from 'vuex'
	const {mapActions:mapUserActions}=createNamespacedHelpers('user')
	export default {
		data() {
			return {
				user:{
					cellphone:'13324537956',
					password:'123456'
				}
			}
		},
		methods: {
			...mapUserActions(['loginAsync']),
			async login(){
				this.loginAsync(this.user)
			}
		}
	}
</script>

<style lang="scss">
	.container {
		width: 750rpx;
		padding: 20rpx;
		box-sizing: border-box;
		.input-item{
			margin-top: 20rpx;
			@include flex-box(between,start,row)
			.input-item-0{
				@include flex-box(between,center,row)
			}
			
		}
		

	}
</style>